
{extend name="index/admin-index" /}
{block name="main"}
</style>
<link rel="stylesheet" href="/public/static/css/bootstrap.min.css">
  <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">管理员公告</strong> / <small>notice management</small></div>
      </div>

      <hr/>

     
      <div class="am-g">
        <div class="am-u-sm-12 container" >

          <table class="am-table am-table-bd am-table-striped admin-content-table table-hover">
            <thead>
            <tr>
              <th><a href="{:url('admin/Looop/add')}" class='btn btn-primary' style='color:#fff;'>上传</a></th>

            </tr>
            <tr>
              <th  class="col-md-1">ID</th>
              <th class="col-md-5">图片地址</th>
              <th class="col-md-2">链接地址</th>
              <th class="col-md-2">操作</th>

            </tr>
            </thead>
            <tbody>
             {volist name="loop" id="v"}
            <tr>
            <td>{$v.id}</td>
            <td>
            <img src="/public/uploads/{$v.path}" width='30'>
            {$v.path}</td>
            <td>{$v.url}</td>
            
              <td id='del'>
    
                    <a href="{:url('admin/Looop/edi',['id'=>$v.id])}" class="btn btn-info " style='color:#fff;'> 编辑</a>
       
                    <span em='{$v.id}' class="btn btn-danger " style='color:#fff;'>删除</span>

              </td>
            </tr>
            {/volist}
           
            </tbody>
          </table>
        </div>
      </div>

  

    </div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
 
<footer>
  <hr>
  <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
</footer>
  </div>
  <script src='/public/static/js/jquery.js'></script>
<script>


    // 删除数据
    $('#del span').click(function() {

      if(confirm('确定删除吗?')){
        $(this).parent().parent().remove();
          $.ajax({
            url:"{:url('admin/Looop/del')}",
            type:'post',
            data:{
              'id':$(this).attr('em'),
            },
          });
      }
    });

 

</script>
{/block}